package loader;

import java.lang.reflect.Method;

public class Demo4
{
    public static void main(String[] args) throws Exception{
        MyLoader loader = new MyLoader("C:\\Users\\Administrator\\Desktop");
        Class clazz = loader.loadClass("PreLoadClass");
        if(clazz != null){
            Object obj = clazz.newInstance();
            System.out.println(obj.getClass().getClassLoader());
            Method sayMethod = clazz.getDeclaredMethod("say", null);
            if(sayMethod != null){
                sayMethod.invoke(obj, null);
            }
        }
    }
}
